package com.kongmou.SpringBatch.batch;

import com.kongmou.SpringBatch.domain.Person;
import org.springframework.batch.item.validator.ValidatingItemProcessor;
import org.springframework.batch.item.validator.ValidationException;

public class CsvItemProcessor extends ValidatingItemProcessor<Person> {

    public Person process(Person item) throws ValidationException {
        super.process(item);
        if ("汉族".equals(item.getNation())) {
            item.setNation("01");
        } else {
            item.setNation("02");
        }
        return item;
    }

}
